package com.example.blackbox.DataBase;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import androidx.annotation.Nullable;

public class DataBase extends SQLiteOpenHelper {
    private  String createTableSql= "create table news("+
            "id integer primary key autoincrement,"+
            "newsTitle text not null,"+
            "newsTag text not null,"+
            "newsMessage text not null,"+
            "newsDate text not null,"+
            "imgUrl text not null,"+
            "level text not null,"+
            "author text not null,"+
            "authorHead text not null,"+
            "info text not null)";


    public DataBase(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(createTableSql);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
